<?php

namespace App\Modules\Apicrzs\Http\Controllers\Buy;

use App\Modules\Apicrzs\Http\Controllers\BaseApicrzsController;
use App\Modules\Apicrzs\Services\Buy\SpreadDeviceServices;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;

class SpreadDeviceController extends BaseApicrzsController
{
    public function __construct(SpreadDeviceServices $service)
    {
        $this->service = $service;
    }
    public function getList(Request $request): JsonResponse
    {
        $params = $request->all();
        $result = $this->service->getLists($params);

        return $this->sendApiSuccess($result, $this->service->getError());
    }
    public function getProfitLists(Request $request): JsonResponse
    {
        $params = $request->all();
        $result = $this->service->getUserProfitsLists($params);

        return $this->sendApiSuccess($result, $this->service->getError());
    }
    public function getQrcode(Request $request): JsonResponse
    {
        $params = $request->all();
        $result = $this->service->getQrcode($params);

        return $this->sendApiSuccess($result, $this->service->getError());
    }

}
